# Module to find libreadline
# To get readline on debian or derivitave install libreadline-dev

# Will define:
# READLINE_INCLUDE_DIR
# READLINE_LIBRARY
# READLINE_FOUND
FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h)
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)

IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
    SET(READLINE_FOUND TRUE)
    MESSAGE(STATUS "Found Readline library at ${READLINE_LIBRARY}")
    MESSAGE(STATUS "Readline headers found at at ${READLINE_INCLUDE_DIR}")
    INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR})
ELSE (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
    SET(READLINE_FOUND FALSE)
    MESSAGE(FATAL_ERROR "Readline library not found!")
ENDIF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
